// 图标检查工具
// 用于验证所有使用的 Ant Design 图标是否存在

export const validateIcons = () => {
  const usedIcons = [
    // Dashboard
    'DatabaseOutlined',
    'SearchOutlined', 
    'HistoryOutlined',
    'CheckCircleOutlined',
    'ExclamationCircleOutlined',
    'ClockCircleOutlined',
    'UserOutlined',
    'RocketOutlined',
    'MonitorOutlined',
    
    // DatabaseConnect
    'ThunderboltOutlined',
    'SaveOutlined',
    
    // QueryInterface
    'SendOutlined',
    'CopyOutlined',
    'DownloadOutlined',
    'CodeOutlined',
    'BulbOutlined',
    
    // QueryHistory
    'EyeOutlined',
    'DeleteOutlined',
    'ReloadOutlined',
    'FilterOutlined',
    
    // DatabaseSchema
    'FieldBinaryOutlined',
    
    // SystemMonitor
    'GlobalOutlined',
    'ApiOutlined',
    
    // Layout
    'DashboardOutlined',
    'MenuFoldOutlined',
    'MenuUnfoldOutlined',
    'SettingOutlined',
    'LogoutOutlined',
  ];

  console.log('使用的图标列表:', usedIcons);
  return usedIcons;
};

// 检查图标是否在 @ant-design/icons 中存在
export const checkIconAvailability = async () => {
  try {
    const icons = await import('@ant-design/icons');
    const availableIcons = Object.keys(icons);
    
    const usedIcons = validateIcons();
    const missingIcons = usedIcons.filter(icon => !availableIcons.includes(icon));
    
    if (missingIcons.length > 0) {
      console.warn('缺失的图标:', missingIcons);
      return false;
    } else {
      console.log('所有图标都可用');
      return true;
    }
  } catch (error) {
    console.error('检查图标时出错:', error);
    return false;
  }
};


